package com.hanock.sm.fork2d;

public class DenyTouchTransform extends Transform {

	
	private int timeFrom;
	private int timeTo;
	
	
	public DenyTouchTransform(int from, int to) {
		timeFrom = from;
		timeTo = to;
	}
	
	@Override
	public void progress(Node node, int time) {
		super.progress(node, time);
		
		int act = getActionTime();
		
		if (timeFrom <= act && act <= timeTo){
			node.setTouchable(false);
		}
	}
	
	@Override
	protected void onFinish(Node node) {
		super.onFinish(node);
		node.setTouchable(true);
	}
	
	@Override
	public boolean isFinished() {
		return getActionTime() > timeTo;
	}

}
